{#include main}
{#title}Indexed Entities{/title}
{#body}
{#if info:indexedEntityTypes.isEmpty}
<p>No indexed entities were found.</p>
{#else}
<form method="post" enctype="application/x-www-form-urlencoded">
    <input id="index" type="submit" class="btn btn-primary mb-2" value="Reindex Entities" >
    <table id="table" class="table table-striped">
        <colgroup>
            <col span="1" style="width: 5%;">
            <col span="1" style="width: 30%;">
            <col span="1" style="width: 65%;">
        </colgroup>
        <thead class="thead-dark">
        <tr>
            <th scope="col">
                <div class="custom-control">
                    <input type="checkbox" class="form-check-input" id="check-all">
                </div>
            </th>
            <th scope="col">Entity name</th>
            <th scope="col">Entity type</th>
        </tr>
        </thead>
        <tbody>
        {#for indexedEntityType in info:indexedEntityTypes}
        <tr>
            <td>
                <div class="custom-control">
                    <input type="checkbox" class="form-check-input checkbox" name="{indexedEntityType.jpaName}" id="{indexedEntityType.jpaName}">
                </div>
            </td>
            <td>{indexedEntityType.jpaName}</td>
            <td>{indexedEntityType.javaClass}</td>
        </tr>
        {/for}
        </tbody>
    </table>
</form>
<script type="text/javascript">
    jQuery('#check-all').change(function() {
        if (this.checked) {
            jQuery('.checkbox').prop('checked', true);
        } else {
            jQuery('.checkbox').prop('checked', false);
        }
    });
</script>
{/if}
{/body}
{/include}
